package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import org.apache.commons.lang3.StringUtils;


public class DaXiangJinFuUtil {

    public static String getReqIp(String ip){
        if (StringUtils.isNotEmpty(ip)){
            return ip;
        }else {
            return "127.0.0.1";
        }
    }

    public static Integer getZhima(String zhima){
        if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm001.getValue(), zhima) || StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima) || StrUtil.equals(BaseTypeInfoEnum.Zhima.zm003.getValue(), zhima)){
            return 43;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm004.getValue(), zhima)){
            return 44;
        }
        return 45;
    }

    public static Integer getXinyongka(String xinyongka){
        if (StrUtil.equals(BaseTypeInfoEnum.XinYongKa.xyk001.getValue(), xinyongka)){
            return 22;
        }
        return 21;
    }

    public static Integer getHouse(String house){
        if (StrUtil.equals(BaseTypeInfoEnum.House.hu001.getValue(), house)){
            return 55;
        }else if (StrUtil.equals(BaseTypeInfoEnum.House.hu004.getValue(), house)){
            return 56;
        }
        return 57;
    }

    public static Integer getCar(String car){
        if (StrUtil.equals(BaseTypeInfoEnum.Car.car001.getValue(), car)){
            return 52;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Car.car003.getValue(), car)){
            return 53;
        }
        return 54;
    }

    public static Integer getFund(String fund){
        if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj001.getValue(), fund)){
            return 36;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj002.getValue(), fund)){
            return 35;
        }
        return 34;
    }

    public static Integer getSocial(String shebao){
        if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb001.getValue(), shebao)){
            return 31;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb002.getValue(), shebao)){
            return 30;
        }
        return 29;
    }

    public static Integer getHuaBei(String huabei){
        if (StrUtil.equals(BaseTypeInfoEnum.Huabei.hb001.getValue(), huabei)){
            return 97;
        }
        return 96;
    }

    public static Integer getBaiTiao(String baitiao){
        if (StrUtil.equals(BaseTypeInfoEnum.Baitiao.bt001.getValue(), baitiao)){
            return 14;
        }
        return 16;
    }

    public static Integer getAmount(String amount){
        if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la001.getValue(), amount) || StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la002.getValue(), amount)){
            return 72;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la003.getValue(), amount)){
            return 73;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la004.getValue(), amount)){
            return 74;
        }
        return 75;
    }

    public static Integer getJob(String gongzuo){
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz001.getValue(), gongzuo)){
            return 17;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz002.getValue(), gongzuo)){
            return 20;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz003.getValue(), gongzuo)){
            return 18;
        }
        return 19;
    }

    public static Integer getXueLi(String xueli){
        if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl001.getValue(), xueli) || StrUtil.equals(BaseTypeInfoEnum.XueLi.xl002.getValue(), xueli)){
            return 87;
        }else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl003.getValue(), xueli)){
            return 88;
        }
        return 89;
    }

    public static Integer getBaoXian(String baoxian){
        if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx001.getValue(), baoxian)){
            return 69;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx002.getValue(), baoxian)){
            return 71;
        }
        return 70;
    }


}
